<template>
  <div id="main">
    <p>子组件</p>
    <p>父传子的值:{{message}}</p>
    <p>子组件的值:{{count}}</p>
    <button @click="recount">减少</button>
  </div>

</template>

<style >
#main{
  height: 500px;
  width: 500px;
  border: 1px solid pink;



}
</style>

<script >
export default {
  props:{
    message: Number
  },
  data(){
    return{
        count:0
    }
  },
  methods:{
    recount(){
      this.count--;
      // 子传父发送数据 $emit
      this.$emit('child',this.count)
    }
  },

}
</script>